

#include "WinRect.h"

Point WinRect::LeftBottom()
{
    return WinRect::Center() + Point(-DESIGN_SIZE.width/2, -DESIGN_SIZE.height/2);
}

Point WinRect::RightBottom()
{
    return WinRect::Center() + Point(DESIGN_SIZE.width/2, -DESIGN_SIZE.height/2);
}

Point WinRect::LeftTop()
{
    return WinRect::Center() + Point(-DESIGN_SIZE.width/2, DESIGN_SIZE.height/2);
}

Point WinRect::RightTop()
{
    return WinRect::Center() + Point(DESIGN_SIZE.width/2, DESIGN_SIZE.height/2);
}

Point WinRect::Right()
{
    return WinRect::Center() + Point(DESIGN_SIZE.width/2, 0);
}

Point WinRect::Left()
{
    return WinRect::Center() + Point(-DESIGN_SIZE.width/2, 0);
}

Point WinRect::Bottom()
{
    return WinRect::Center() + Point(0, -DESIGN_SIZE.height/2);
}

Point WinRect::Top()
{
    return WinRect::Center() + Point(0, DESIGN_SIZE.height/2);
}

Point WinRect::Center()
{
    auto V = Director::getInstance()->getOpenGLView()->getVisibleRect();
    return Point(V.origin.x+V.size.width/2, V.origin.y+V.size.height/2);
}